<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试时间生成</title>
</head>
<body>

<script>
    console.log(new Date().toLocaleDateString())
    console.log(new Date().toLocaleString())
    let time = new Date();
    let fullYear = time.getFullYear();
    let date = time.getDate();
    let month = time.getMonth();
    let hours = time.getHours();
    let minutes = time.getMinutes();
    console.log(fullYear+"/"+month + "/" + date + " " + hours + ":" + minutes);

</script>
</body>
</html>